package com.example.factory.core.domain;

import javax.persistence.*;
import java.util.List;

/**
 * @author Lei Tao
 */
@Entity
@Table(name = "report_level_1_dimension")
public class ReportLevel1Dimension extends DomainObject {
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "level_1_dimension_id")
    private Level1Dimension level1Dimension;

    @OneToMany(mappedBy = "reportLevel1Dimension", fetch = FetchType.LAZY, orphanRemoval = true)
    private List<ReportLevel2Dimension> reportLevel2Dimensions;

    @Column(name = "total_score")
    private Float totalScore;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "report_plan_id")
    private ReportPlan reportPlan;

    @OneToOne
    private ReportEquipment reportEquipment;

    public ReportLevel1Dimension() {
    }

    public ReportPlan getReportPlan() {
        return reportPlan;
    }

    public void setReportPlan(ReportPlan reportPlan) {
        this.reportPlan = reportPlan;
    }

    public List<ReportLevel2Dimension> getReportLevel2Dimensions() {
        return reportLevel2Dimensions;
    }

    public void setReportLevel2Dimensions(List<ReportLevel2Dimension> reportLevel2Dimensions) {
        this.reportLevel2Dimensions = reportLevel2Dimensions;
    }

    public Level1Dimension getLevel1Dimension() {
        return level1Dimension;
    }

    public void setLevel1Dimension(Level1Dimension level1Dimension) {
        this.level1Dimension = level1Dimension;
    }

    public Float getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Float totalScore) {
        this.totalScore = totalScore;
    }
}
